package com.zone.component_home.viewmodel

import android.util.Log
import androidx.databinding.ObservableArrayList
import com.zone.component_home.model.SquareModel
import com.zone.component_home.repository.DataHttpRepository
import com.zone.component_home.viewtype.ItemViewType
import com.zone.core.base.BaseViewModel

class SquareViewModel(val dataHttp: DataHttpRepository) : BaseViewModel() {
    val squareModels = ObservableArrayList<SquareModel>()
    val itemViewType = ItemViewType()

    init {
        squareModels.add(SquareModel("------------", "A", 1))
        squareModels.add(SquareModel("------------", "B"))
        squareModels.add(SquareModel("------------", "C"))
        squareModels.add(SquareModel("------------", "D"))

        launch {
            Log.d("TAG", "onClick: ==" + dataHttp.getLogin())
        }
    }

    fun onClick(item: SquareModel) {
        launch {
            Log.d("TAG", "onClick: ==" + dataHttp.getLogin())
        }
    }
}